package domd9;

class Marray<E>{
   public Object[] obj=new Object[10];
    public void setobj(int pos,Object arrays){
        this.obj[pos]=arrays;
    }
    public E getobj(int pos){
        return (E)this.obj[pos];
    }
}
public class Test {
    public static void main(String[] args) {
           Marray<Integer> marray=new Marray<>();
           Object array=new Object();
           marray.setobj(0,1);//整型
           marray.setobj(1,"hello");//字符串
         //String str=marray.getobj(1);
         int INT=marray.getobj(0);
        System.out.println(INT);

    }
}
